package com.example.restatr.Atcivity.YouthInn;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.os.Bundle;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.TextView;

import com.example.restatr.Atcivity.YouthInn.Bean.PolicyInfoBean;
import com.example.restatr.R;
import com.example.restatr.Tools;
import com.google.gson.Gson;

public class PolicyAt extends AppCompatActivity {
    private Toolbar toolbar;
    private TextView barTitle;
    private EditText search;
    private WebView web;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_policy_at);

        toolbar = findViewById(R.id.toolbar);
        barTitle = findViewById(R.id.bar_Title);
        search = findViewById(R.id.search);
        web = findViewById(R.id.web);

        PolicyInfoBean.DataBean data = new Gson().fromJson(getIntent().getStringExtra("data"), PolicyInfoBean.class).getData();
        Tools.SetBarTitle(toolbar, barTitle, data.getTitle(), search, this, false);
        web.loadData(data.getContent(), "text/html", "utf-8");
    }
}